package com.liukuan.netty.bio;

import java.io.*;
import java.net.Socket;
import java.net.UnknownHostException;

/**
 * Created by liukuan on 16/3/30.
 */
public class BioTimeClient {

    public static void main(String[] args) throws UnknownHostException, IOException {
        Socket socket = new Socket("127.0.0.1", 5678);
        OutputStream out = socket.getOutputStream();
        String command = "time";
        out.write(command.getBytes());
        socket.shutdownOutput();

        InputStream in = socket.getInputStream();
        BufferedReader br = new BufferedReader(new InputStreamReader(in));
        String serverTime = br.readLine();
        System.out.println(serverTime);
        socket.close();
    }

}
